let express = require("express")
let bodyParser = require('body-parser');
let app = express()
app.use(bodyParser.urlencoded({ extended: true }))
app.use(express.static('static'))
app.get('/user/list', (req, res) => {
  res.send({
    error: 0,
    message: 'ok',
    data: [
      { username: 'jack', age: '20', email: 'tom@qq.com', phone: '18013830666' },
      { username: 'tom', age: 18, email: 'tom@qq.com', phone: '18013830878' },
      { username: 'lili', age: 16, email: 'tom@qq.com', phone: '18013830868' },
      { username: 'sue', age: 22, email: 'tom@qq.com', phone: '18013830848' }
    ]
  })
})
app.get('/user/tree', (req, res) => {
  res.send({
    error: 0,
    message: 'ok',
    data: [{ id: 1, text: 'HTMl', iconClass: 'icon-save', state: 'closed', pid: 0 },
    { id: 2, text: 'Css', iconClass: 'icon-ok', state: '', pid: 1 },
    { id: 3, text: 'Doms', iconClass: '', state: '', pid: 1 },
    { id: 4, text: 'Js', iconClass: '', state: '', pid: 2 }],
  })
})
app.listen(888)

// localhost:888/a